namespace BB.Apostas.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class v7 : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.Apostas", "UserId", c => c.Int(nullable: false));
            AddColumn("dbo.Apostas", "JogoId", c => c.Int(nullable: false));
            AddColumn("dbo.Apostas", "HomeScore", c => c.Int(nullable: false));
            AddColumn("dbo.Apostas", "AwayScore", c => c.Int(nullable: false));
            AddColumn("dbo.Apostas", "Score", c => c.Int(nullable: false));
            AddForeignKey("dbo.Apostas", "UserId", "dbo.UserProfile", "UserId", cascadeDelete: true);
            AddForeignKey("dbo.Apostas", "JogoId", "dbo.Jogoes", "Id", cascadeDelete: true);
            CreateIndex("dbo.Apostas", "UserId");
            CreateIndex("dbo.Apostas", "JogoId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.Apostas", new[] { "JogoId" });
            DropIndex("dbo.Apostas", new[] { "UserId" });
            DropForeignKey("dbo.Apostas", "JogoId", "dbo.Jogoes");
            DropForeignKey("dbo.Apostas", "UserId", "dbo.UserProfile");
            DropColumn("dbo.Apostas", "Score");
            DropColumn("dbo.Apostas", "AwayScore");
            DropColumn("dbo.Apostas", "HomeScore");
            DropColumn("dbo.Apostas", "JogoId");
            DropColumn("dbo.Apostas", "UserId");
        }
    }
}
